home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / term < prev    next >
Internet Message Format  |  1995-03-31  |  3KB

  1. Path: santra!tut!sunic!mcsun!uunet!mailrus!tut.cis.ohio-state.edu!snorkelwacker!mit-eddie!ll-xn!rsteele
  2. From: rsteele@XN.LL.MIT.EDU (Rob Steele)
  3. Newsgroups: comp.sys.handhelds
  4. Subject: HP48 terminal emulator
  5. Message-ID: <1749@xn.LL.MIT.EDU>
  6. Date: 12 Mar 90 20:08:51 GMT
  7. Reply-To: rsteele@LL-XN.ARPA.ll.mit.edu (Rob Steele)
  8. Organization: MIT Lincoln Laboratory
  9. Lines: 100
  10.  
  11. It's wierd having Kermit file transfer without terminal emulation.
  12. The following is TERM, a dumb terminal emulator for the HP48SX.
  13. It's slow and chokes easily on fast input.  Still, it might be
  14. usefull to someone.  It uses whatever communications parameters
  15. you establish in [I/O] [SETUP] and works by alternatly polling the
  16. keypad and the input buffer.  The alpha key functions as a shift-
  17. lock.
  18.  
  19. This is my first whack at programming the 48 and I would apreciate
  20. some criticism regarding style.  Like, how are you supposed to comment
  21. a program?
  22.  
  23. Five dollars to the first person who rewrites this to be interrupt
  24. driven.
  25.  
  26. Rob Steele
  27. MIT Lincoln Laboratory
  28. They didn't hire me for my opinions.
  29.  
  30.  
  31. TERM, 1063 bytes, # 3B1Fh checksum
  32.  
  33. %%HP: T(3)A(D)F(.);
  34. \<<
  35.     # 0d
  36.  
  37.     \-> col
  38.     
  39.     \<<
  40.         1
  41.         
  42.         "..........ABCDEF....GHIJKL....MNOPQR....STUVWX....
  43. YZ........789/......456*......123-......0. +"
  44.  
  45.         "..........abcdef....ghijkl....mnopqr....stuvwx....
  46. yz........789/......456*......123-......0. +"
  47.  
  48.         \<<
  49.             DUP RCL 55 8 CHR REPL SWAP STO
  50.         \>>
  51.         
  52.         \<<
  53.             PICT DUP { # 0d # 0d } OVER
  54.             { # 0d # 8d } { # 130d # 63d } SUB REPL
  55.             {# 0d # 56d } # 131d # 8d BLANK REPL
  56.              # 0d 'col' STO
  57.         \>>
  58.         
  59.         \-> caps uctbl lctbl addbs nl
  60.         
  61.         \<<
  62.             'uctbl' addbs EVAL
  63.             'lctbl' addbs EVAL
  64.         
  65.             -40 CF
  66.             OPENIO
  67.             { # 0d # 0d } PVIEW
  68.             7 FREEZE
  69.             nl EVAL
  70.             
  71.             WHILE 1 REPEAT
  72.                 IF KEY THEN
  73.                     IF DUP 61 == THEN
  74.                         DROP caps NOT 'caps' STO
  75.                     ELSE
  76.                         IF caps THEN
  77.                             uctbl
  78.                         ELSE
  79.                             lctbl
  80.                         END
  81.                         SWAP DUP SUB XMIT DROP
  82.                     END
  83.                 END
  84.  
  85.                 IF BUFLEN DROP THEN
  86.                     1 SRECV DROP DUP NUM
  87.                     CASE
  88.                         DUP 8 == THEN
  89.                             DROP2
  90.                             IF col # 0d > THEN
  91.                                 col # 6d - 'col' STO 
  92.                             END
  93.                         END
  94.                         
  95.                         13 == THEN
  96.                             DROP nl EVAL
  97.                         END
  98.                         
  99.                         2 \->GROB
  100.                         PICT col # 56d 2 \->LIST ROT REPL
  101.                         # 6d 'col' STO+
  102.                         IF col # 131d > THEN
  103.                             nl EVAL
  104.                         END
  105.                     END
  106.                 END
  107.             END
  108.         \>>
  109.     \>>
  110. \>>
  111.  
  112.